<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/form_validate.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:15 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>H+ 后台主题UI框架 - 表单验证 jQuery Validation</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="/static/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/static/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/static/css/animate.min.css" rel="stylesheet">
    <link href="/static/css/style.min862f.css?v=4.1.0" rel="stylesheet">

    <style>
        #changePass:hover {
            cursor: pointer;
        }
    </style>

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">


    <div class="row">
        <div class="col-sm-10">
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">消费返现</a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">充值余额消费</a>
                    </li>
                </ul>
                <div class="tab-content">

                    <div id="tab-1" class="tab-pane active">
                        <div class="panel-body">

                            <form class="form-horizontal m-t" id="x_form">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">手机号码或卡号：</label>
                                    <div class="col-sm-8">
                                        <input id="x_phoneorkahao" name="phoneOrKahao" minlength="2" type="text"
                                               class="form-control"
                                               required=""
                                               aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">消费金额：</label>
                                    <div class="col-sm-8">
                                        <input id="x_money" type="text" class="form-control" name="jine" required=""
                                               aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">可返现余额：</label>
                                    <div class="col-sm-8">
                                        <input id="kefanxianyue" type="text" class="form-control" name="" required=""
                                               aria-required="true" disabled="">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">商品描述：</label>
                                    <div class="col-sm-8">
                                        <input id="x_miaoshu" type="text" class="form-control" name="miaoshu">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <input class="btn btn-primary" type="button" value="提交" id="x_tijiao"/>
                                    </div>
                                </div>
                            </form>

                        </div>
                    </div>
                    <!--充值消费-->
                    <div id="tab-2" class="tab-pane">
                        <div class="panel-body">

                            <form class="form-horizontal m-t" id="c_chongzhixiaofeiform">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">手机号码或卡号：</label>
                                    <div class="col-sm-8">
                                        <input id="c_phoneorkahao" name="phoneorkahao" minlength="2" type="text"
                                               class="form-control"
                                               required=""
                                               aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">可用余额：</label>
                                    <div class="col-sm-8">
                                        <input id="c_chongzhiyue" type="text" class="form-control" name="" required=""
                                               aria-required="true" disabled="">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">消费金额：</label>
                                    <div class="col-sm-8">
                                        <input id="c_jine" type="text" class="form-control" name="jine" required=""
                                               aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">商品描述：</label>
                                    <div class="col-sm-8">
                                        <input id="c_miaoshu" type="text" class="form-control" name="miaoshu">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">密码：</label>
                                    <div class="col-sm-8">
                                        <input id="c_password" type="password" class="form-control" name="password">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label"></label>
                                    <div class="col-sm-8">
                                        <p class="text-muted">
                                            <small id="changePass" style="color: #bd2c27" data-toggle="modal"
                                                   data-target="#myModal2">忘记密码了？
                                            </small>
                                        </p>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <input class="btn btn-primary" type="button" value="提交" id="c_tijiao"/>
                                    </div>
                                </div>
                            </form>


                        </div>
                    </div>

                </div>


            </div>
        </div>

    </div>
    <br/>
    <br/>
    <div class="row">
        <div class="col-sm-10">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>会员注册</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="form_basic.html#">选项1</a>
                            </li>
                            <li><a href="form_basic.html#">选项2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">姓名：</label>
                            <div class="col-sm-8">
                                <input id="customername" name="name" class="form-control" type="text"
                                       required="required">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请填写姓名</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">卡号：</label>
                            <div class="col-sm-8">
                                <input id="kahao" name="kahao" class="form-control" type="text" required="required"
                                       aria-required="true" aria-invalid="false" class="valid">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">手机号码：</label>
                            <div class="col-sm-8">
                                <input id="phone" name="phone" class="form-control" type="text" required="required"
                                       aria-required="true" aria-invalid="true" class="error">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">密码：</label>
                            <div class="col-sm-8">
                                <input id="password" name="password" class="form-control" type="password"
                                       required="required">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">确认密码：</label>
                            <div class="col-sm-8">
                                <input id="confirm_password" name="confirm_password" class="form-control"
                                       type="password" required="required">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">身份证后六位：</label>
                            <div class="col-sm-8">
                                <input id="shenfen1" name="idcard" class="form-control" type="password"
                                       required="required">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">身份证后六位：</label>
                            <div class="col-sm-8">
                                <input id="shenfen2" name="idcard1" class="form-control" type="password"
                                       required="required">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的身份证后六位</span>
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <input class="btn btn-primary" id="zhuce" value="提交" type="button"/>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-10">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>会员充值</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="form_basic.html#">选项1</a>
                            </li>
                            <li><a href="form_basic.html#">选项2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="commentForm">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">手机号码或卡号：</label>
                            <div class="col-sm-8">
                                <input id="kaorph" name="name" minlength="2" type="text" class="form-control"
                                       required=""
                                       aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">充值额度：</label>
                            <div class="col-sm-8">
                                <input id="money" type="text" class="form-control" name="email" required=""
                                       aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">赠送描述：</label>
                            <div class="col-sm-8">
                                <input id="miaoshu" type="text" class="form-control" name="url">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <input class="btn btn-primary" type="button" value="提交" id="chongzhi"/>
                            </div>
                        </div>
                    </form>
                </div>

            </div>
        </div>
    </div>


</div>

<div class="modal inmodal" id="myModal2" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated flipInY">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h4 class="modal-title">重置密码</h4>
                <small class="font-bold">
            </div>
            <div class="modal-body">

                    <form class="form-horizontal m-t" id="changePass_form">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">手机号码或卡号：</label>
                            <div class="col-sm-8">
                                <input id="change_shoujihaoma" name="phoneOrKahao" minlength="2" type="text" class="form-control"
                                       required=""
                                       aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">身份证后六位：</label>
                            <div class="col-sm-8">
                                <input id="fenfenzheng" name="shenfenzheng" minlength="2" type="password" class="form-control"
                                       required=""
                                       aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">新密码：</label>
                            <div class="col-sm-8">
                                <input id="xinmima1" type="password" class="form-control" name="xinmima" required=""
                                       aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">确认新密码：</label>
                            <div class="col-sm-8">
                                <input id="xinmima2" type="password" class="form-control" name="url">
                            </div>
                        </div>


                    </form>



            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <input type="button" class="btn btn-primary" id="gaimima" value="提交">
            </div>
        </div>
    </div>
</div>


<script src="/static/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="/static/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/static/js/content.min.js?v=1.0.0"></script>
<script src="/static/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/static/js/plugins/validate/messages_zh.min.js"></script>
<script src="/static/js/demo/form-validate-demo.min.js"></script>

<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>

<script>
    $(function () {

        function yanzheng(data) {
            if (data == null || data == "") {
                return "no";
            } else {
                return "ok";
            }
        }

        function bidui(da1, da2) {
            if (da1 != da2) {
                return "no";
            }
        }


        $("#zhuce").click(function () {


            if (yanzheng($("#customername").val()) == "no") {
                //alert("姓名不能为空！");
                swal({
                    title: "提示",
                    text: "姓名不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng($("#kahao").val()) == "no") {
                //alert("卡号不能为空！");
                swal({
                    title: "提示",
                    text: "卡号不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng($("#phone").val()) == "no") {
                // alert("手机号码不能为空！");
                swal({
                    title: "提示",
                    text: "手机号码不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }

            if (yanzheng($("#password").val()) == "no") {
                //alert("密码不能为空！");
                swal({
                    title: "提示",
                    text: "密码不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng($("#confirm_password").val()) == "no") {
                //alert("确认密码不能为空！");
                swal({
                    title: "提示",
                    text: "确认密码不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng($("#shenfen1").val()) == "no") {
                //alert("身份证后六位不能为空！");
                swal({
                    title: "提示",
                    text: "身份证后六位不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng($("#shenfen2").val()) == "no") {
                //alert("确认身份不能为空！");
                swal({
                    title: "提示",
                    text: "确认身份不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (bidui($("#password").val(), $("#confirm_password").val()) == "no") {
                // alert("确认密码不一致！");
                swal({
                    title: "提示",
                    text: "确认密码不一致！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (bidui($("#shenfen1").val(), $("#shenfen2").val()) == "no") {
                //alert("确认身份证不一致！");
                swal({
                    title: "提示",
                    text: "确认身份证不一致！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }

            if ($("#phone").val().length != 11) {
                //alert("手机号码必须是11位！")
                swal({
                    title: "提示",
                    text: "手机号码必须是11位！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }

            $.get("/vaphone", {"phone": $("#phone").val()}, function (data) {
                if (data == "no") {
                    // alert("手机号码已经注册！");
                    swal({
                        title: "提示",
                        text: "机号码已经注册！",
                        type: "warning",
                        //showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        // confirmButtonText: "删除",
                        // closeOnConfirm: false
                    });
                } else {

                    $.post("/registerCustomer", $("#signupForm").serialize(), function (data) {
                        if (data == "ok") {
                            swal({
                                title: "恭喜",
                                text: "注册成功！",
                                type: "success",
                                //showCancelButton: true,
                                confirmButtonColor: "#18d9dd",
                                // confirmButtonText: "删除",
                                // closeOnConfirm: false
                            });
                            $("#customername").val("");
                            $("#kahao").val("");
                            $("#phone").val("");
                            $("#password").val("");
                            $("#shenfen1").val("");
                            $("#shenfen2").val("");
                            $("#confirm_password").val("");
                        }
                    })

                }
            });


        })
        //

        $("#kaorph").blur(function () {
            if ($("#kaorph").val() != null && $("#kaorph").val() != "") {
                $.get("/isexist", {"phoneAndkahao": $("#kaorph").val()}, function (data) {
                    if (data == "no") {
                        // alert("手机号码或者卡号不存在！");
                        swal({
                            title: "提示",
                            text: "机号码或者卡号不存在！",
                            type: "warning",
                            //showCancelButton: true,
                            confirmButtonColor: "#DD6B55",
                            // confirmButtonText: "删除",
                            // closeOnConfirm: false
                        });
                        $("#kaorph").val("");

                    }
                })
            }
        })
        //
        $("#money").blur(function () {
            var money = $(this).val();
            if (isNaN(money)) {
                // alert("充值额度必须是数字！");
                swal({
                    title: "提示",
                    text: "充值金额必须是数字！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                $(this).val("");
            }
            if (parseFloat(money) <= 0) {
                swal({
                    title: "提示",
                    text: "充值金额必须大于0！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                $(this).val("");
            }
        });
        //
        $("#chongzhi").click(function () {

            if (yanzheng($("#kaorph").val()) == "no") {
                swal({
                    title: "提示",
                    text: "手机号码或者卡号不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng($("#money").val()) == "no") {
                swal({
                    title: "提示",
                    text: "充值金额不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng($("#miaoshu").val()) == "no") {
                swal({
                    title: "提示",
                    text: "赠送服装描述不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            $.post("/insertXiaofei", {
                "phoneAndKahao": $("#kaorph").val(),
                "miaoshu": $("#miaoshu").val(),
                "jine": $("#money").val()
            }, function (data) {
                if (data == "ok") {
                    swal({
                        title: "恭喜",
                        text: "充值成功！",
                        type: "success",
                        //showCancelButton: true,
                        confirmButtonColor: "#18d9dd",
                        // confirmButtonText: "删除",
                        // closeOnConfirm: false
                    });
                    $("#kaorph").val("");
                    $("#miaoshu").val("");
                    $("#money").val("");
                } else {
                    swal({
                        title: "提示",
                        text: "充值失败！",
                        type: "warning",
                        //showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        // confirmButtonText: "删除",
                        // closeOnConfirm: false
                    });
                }

            })


        })
        //

        $("#x_phoneorkahao").blur(function () {
            if ($(this).val() != null && $(this).val() != "") {
                $.get("/isexist", {"phoneAndkahao": $(this).val()}, function (data) {
                    if (data == "no") {
                        // alert("手机号码或者卡号不存在！");
                        swal({
                            title: "提示",
                            text: "机号码或者卡号不存在！",
                            type: "warning",
                            //showCancelButton: true,
                            confirmButtonColor: "#DD6B55",
                            // confirmButtonText: "删除",
                            // closeOnConfirm: false
                        });
                        $("#x_phoneorkahao").val("");

                    } else {
                        $.get("/selectFanXianYue", {"phoneOrKahao": $("#x_phoneorkahao").val()}, function (data) {
                            $("#kefanxianyue").val(data);
                        })
                    }
                })
            }
        })
        //
        $("#x_money").blur(function () {
            var money = $(this).val();
            if (isNaN(money)) {
                // alert("充值额度必须是数字！");
                swal({
                    title: "提示",
                    text: "消费额度必须是数字！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                $("#x_money").val("");
            }
            if (parseFloat(money) <= 0) {
                swal({
                    title: "提示",
                    text: "消费额度必须大于0！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                $("#x_money").val("");
            }
        });
        //
        $("#x_tijiao").click(function () {
            if (yanzheng($("#x_phoneorkahao").val()) == "no") {
                swal({
                    title: "提示",
                    text: "手机号码或者卡号不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng($("#x_money").val()) == "no") {
                swal({
                    title: "提示",
                    text: "消费金额不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng($("#x_miaoshu").val()) == "no") {
                swal({
                    title: "提示",
                    text: "商品描述不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }

            $.post("/insertxiaofei", $("#x_form").serialize(), function (data) {
                if (data == "ok") {
                    swal({
                        title: "恭喜",
                        text: "消费返现成功！",
                        type: "success",
                        //showCancelButton: true,
                        confirmButtonColor: "#18d9dd",
                        // confirmButtonText: "删除",
                        // closeOnConfirm: false
                    });
                    $("#x_phoneorkahao").val("");
                    $("#x_money").val("");
                    $("#x_miaoshu").val("");
                    $("#kefanxianyue").val("");
                } else {
                    swal({
                        title: "提示",
                        text: "消费返现失败！",
                        type: "warning",
                        //showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        // confirmButtonText: "删除",
                        // closeOnConfirm: false
                    });
                    $("#x_phoneorkahao").val("");
                    $("#x_money").val("");
                    $("#x_miaoshu").val("");
                    $("#kefanxianyue").val("");
                }
            })
        });
        //
        $("#c_phoneorkahao").blur(function () {
            if ($(this).val() != null && $(this).val() != "") {
                $.get("/isexist", {"phoneAndkahao": $(this).val()}, function (data) {
                    if (data == "no") {
                        // alert("手机号码或者卡号不存在！");
                        swal({
                            title: "提示",
                            text: "手机号码或者卡号不存在！",
                            type: "warning",
                            //showCancelButton: true,
                            confirmButtonColor: "#DD6B55",
                            // confirmButtonText: "删除",
                            // closeOnConfirm: false
                        });
                        $("#c_phoneorkahao").val("");

                    } else {
                        $.get("/getCustomerChongZhiYue", {"phoneOrKahao": $("#c_phoneorkahao").val()}, function (data) {
                            $("#c_chongzhiyue").val(data);
                        })
                    }
                })
            }
        })
        //
        $("#c_tijiao").click(function () {

            var phoneorkahao = $("#c_phoneorkahao").val();
            var jine = $("#c_jine").val();
            var miaoshu = $("#c_miaoshu").val();
            var password = $("#c_password").val();
            if (yanzheng(phoneorkahao) == "no") {
                swal({
                    title: "提示",
                    text: "手机号码或卡号不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng(jine) == "no") {
                swal({
                    title: "提示",
                    text: "消费金额不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng(miaoshu) == "no") {
                swal({
                    title: "提示",
                    text: "商品描述不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if (yanzheng(password) == "no") {
                swal({
                    title: "提示",
                    text: "密码不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }

            $.post("/insertChongZhiXiaoFei", $("#c_chongzhixiaofeiform").serialize(), function (data) {
                if (data == "ok") {
                    swal({
                        title: "恭喜",
                        text: "消费成功！",
                        type: "success",
                        //showCancelButton: true,
                        confirmButtonColor: "#18d9dd",
                        // confirmButtonText: "删除",
                        // closeOnConfirm: false
                    });
                    $("#c_phoneorkahao").val("");
                    $("#c_jine").val("");
                    $("#c_miaoshu").val("");
                    $("#c_password").val("");
                    $("#c_chongzhiyue").val("");
                    return;
                }
                if (data == "passerror") {
                    swal({
                        title: "提示",
                        text: "密码错误！",
                        type: "warning",
                        //showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        // confirmButtonText: "删除",
                        // closeOnConfirm: false
                    });
                    $("#c_password").val("");
                    return;
                }
                if (data == "yuebuzu") {
                    swal({
                        title: "提示",
                        text: "余额不足请充值！",
                        type: "warning",
                        //showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        // confirmButtonText: "删除",
                        // closeOnConfirm: false
                    });
                    $("#c_phoneorkahao").val("");
                    $("#c_jine").val("");
                    $("#c_miaoshu").val("");
                    $("#c_password").val("");
                    $("#c_chongzhiyue").val("");
                    return;
                }
                else {
                    swal({
                        title: "提示",
                        text: "消费失败！",
                        type: "warning",
                        //showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        // confirmButtonText: "删除",
                        // closeOnConfirm: false
                    });
                    $("#c_phoneorkahao").val("");
                    $("#c_jine").val("");
                    $("#c_miaoshu").val("");
                    $("#c_password").val("");
                    $("#c_chongzhiyue").val("");
                    return;
                }
            })

        })
        //
        $("#c_jine").blur(function () {
            if (isNaN($(this).val())) {
                // alert("充值额度必须是数字！");
                swal({
                    title: "提示",
                    text: "消费额度必须是数字！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                $("#c_jine").val("");
            }
            if (parseFloat($(this).val()) <= 0) {
                swal({
                    title: "提示",
                    text: "消费额度必须大于0！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                $("#c_jine").val("");
            }
        });
        //
        $("#gaimima").click(function () {
            var shoujiorkahao=$("#change_shoujihaoma").val();
            var shenfenzheng=$("#fenfenzheng").val();
            var mima1=$("#xinmima1").val();
            var mima2=$("#xinmima2").val();
            if(yanzheng(shoujiorkahao)=="no"){
                swal({
                    title: "提示",
                    text: "手机号码或卡号不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            };
            if(yanzheng(shenfenzheng)=="no"){
                swal({
                    title: "提示",
                    text: "身份证后六位不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if(yanzheng(mima1)=="no"){
                swal({
                    title: "提示",
                    text: "新密码不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if(yanzheng(mima2)=="no"){
                swal({
                    title: "提示",
                    text: "确认新密码不能为空！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            if(bidui(mima1,mima2)=="no"){
                swal({
                    title: "提示",
                    text: "新密码与确认密码必须一致！",
                    type: "warning",
                    //showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    // confirmButtonText: "删除",
                    // closeOnConfirm: false
                });
                return;
            }
            $.post("/changePassword",$("#changePass_form").serialize(),function (data) {
                   if(data=="ok"){
                       swal({
                           title: "恭喜",
                           text: "密码重置成功！",
                           type: "success",
                           //showCancelButton: true,
                           confirmButtonColor: "#18d9dd",
                           // confirmButtonText: "删除",
                           // closeOnConfirm: false
                       });
                       return;
                   }
                   if(data=="shenerror"){
                       swal({
                           title: "提示",
                           text: "身份证信息与系统不符！",
                           type: "warning",
                           //showCancelButton: true,
                           confirmButtonColor: "#DD6B55",
                           // confirmButtonText: "删除",
                           // closeOnConfirm: false
                       });
                       return;
                   }
            })


        })
        //
        $("#change_shoujihaoma").blur(function () {
            if ($(this).val() != null && $(this).val() != "") {
                $.get("/isexist", {"phoneAndkahao": $(this).val()}, function (data) {
                    if (data == "no") {
                        // alert("手机号码或者卡号不存在！");
                        swal({
                            title: "提示",
                            text: "机号码或者卡号不存在！",
                            type: "warning",
                            //showCancelButton: true,
                            confirmButtonColor: "#DD6B55",
                            // confirmButtonText: "删除",
                            // closeOnConfirm: false
                        });
                        $("#change_shoujihaoma").val("");

                    }
                })
            }
        })



    })

</script>


<!-- Mirrored from www.zi-han.net/theme/hplus/form_validate.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:16 GMT -->
</html>
